package com.by.yz.common;

import android.app.Activity;
import android.content.Intent;

import com.by.yz.R;


/**
 * Description :页面跳转
 * Author : AllenJuns
 * Date   : 2016-3-03
 */
public class MFGT {
    /**
     * 右侧动画关闭 Activity
     *
     * @param activity
     */
    public static void finish(Activity activity) {
        activity.finish();
        activity.overridePendingTransition(R.anim.push_right_in,
                R.anim.push_right_out);
    }

    /**
     * 底部动画关闭 Activity
     *
     * @param activity
     */
    public static void finishFormBottom(Activity activity) {
        activity.finish();
        activity.overridePendingTransition(R.anim.push_bottom_in,
                R.anim.push_bottom_out);
    }


    public static void startActivity(Activity context, Class<?> cls) {
        Intent intent = new Intent();
        intent.setClass(context, cls);
        context.startActivity(intent);
        context.overridePendingTransition(R.anim.push_left_in,
                R.anim.push_left_out);
    }

}
